<extend name="./Application/Admin/View/common/base.html" />
<block name="crumb">
    <span class="c-gray en">&gt;</span> 退货管理
    <span class="c-gray en">&gt;</span> 退货列表
</block>
<block name="content">

    <div class="text-c">
        <form action="" method="get">
            <input type="hidden" name="m" value="admin"/>
            <input type="hidden" name="c" value="returnGood"/>
            <input type="hidden" name="a" value="index"/>
            <input type="text" name="order_id" placeholder="填写订单编号"class="input-text" value="{$x_order_id}" style="width:220px">
            <span class="btn-upload form-group">
            <input type="file" multiple name="file-2" class="input-file">
        </span>

            <span class="select-box" style="width:150px">
                <select class="select" name="state" size="1">
                    <foreach name="state" item="vo" key="k">
                        <if condition="$k eq $x_state">
                            <option value="{$k}" selected="selected">{$vo}</option>
                            <else />
                            <option value="{$k}">{$vo}</option>
                        </if>
                    </foreach>
                </select>
            </span>

            <button type="submit" class="btn btn-success" name="btn" value="1"><i class="Hui-iconfont"></i> 查询</button>

        </form>
    </div>

    <div class="mt-10">
        <table class="table table-border table-bordered table-bg table-sort">
            <thead>
            <tr class="text-c">
                <th width="70">ID</th>
                <th width="160">订单编号</th>
                <th>申请人</th>
                <th>类型</th>
                <th>申请日期</th>
                <th>状态</th>
                <th width="200">操作</th>
            </tr>
            </thead>
            <tbody>
                <volist name="returnGood" id="return" key="k" >
                    <tr class="text-c">
                        <td>{$k}</td>
                        <td>{$return['order_id']}</td>
                        <td>{$return['agent_name']}</td>
                        <td>

                            <if condition="$return['state'] eq 1">
                                退款
                                <else />
                                退货退款
                            </if>

                        </td>
                        <td>{$return['now_time']|date="Y-m-d H:i:s",###}</td>
                        <td>
                            <if condition="$return['state'] eq 1">
                                    <span class="label label-success radius ">已通过</span>
                                <elseif condition="$return['state'] eq 0"/>
                                    <span class="label label-info radius">未审核</span>
                                <else />
                                    <span class="label label-danger radius">不通过</span>
                            </if>
                        </td>

                        <td class="f-14 product-brand-manage">
                            <a href="{:U('ReturnGood/detail', array('id'=>$return['id']))}" class="btn btn-secondary radius size-MINI"><i class="Hui-iconfont Hui-iconfont-yulan"></i>查看</a>
<!--
                            <a href="javascript:;" class="btn btn-danger radius size-MINI del_brand" iid="{$brand['id']}"><i class="Hui-iconfont Hui-iconfont-del2"></i>删除</a>
-->
                        </td>
                    </tr>
                </volist>
            </tbody>
        </table>
    </div>
    <div class="page" style="margin-top: 10px;">{$page}</div>
</block>

<!--自己的css和js-->
<block name="css">
    <link href="__PUBLIC__/Admin/static/ext/css/zoomify.css" rel="stylesheet" type="text/css" />
</block>
<block name="js">
    <script type="text/javascript" src="__PUBLIC__/Admin/static/ext/js/zoomify.js"></script>
    <script type="text/javascript">
        $('.large_img').zoomify();
        $(function () {
            $('.del_brand').click(function () {
                var _this = $(this);
                layer.confirm('您确认删除此退货吗？', {
                    btn: ['确认','取消']
                }, function(){
                    $.ajax({
                        url: "{:U('Brand/del')}",
                        type: "post",
                        data: {
                          id: _this.attr('iid')
                        },
                        beforeSend: function () {
                            //layer.msg('删除退货中..', {icon: 16,time:500});
                        },
                        success: function (msg) {
                            //alert(msg);
                            if (msg == -1) {
                                layer.msg('此退货有商品占用，请先删除!', {icon: 8,time:1000});
                            } else if(msg == 1) {
                                window.location.href = "{:U('Brand/index')}";
                            } else {
                                layer.msg('修改失败!', {icon: 2,time:1000});
                            }
                            //msg==1 ? window.location.href = "{:U('Brand/index')}" : layer.msg('修改失败!', {icon: 2,time:1000});
                        }
                    });
                });
            });
        });
        $('.large_img').zoomify();

    </script>
</block>



